#define _CRT_SECURE_NO_WARNINGS
#include "Slist.h"

void test01() {
	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
	node1->next = node2;
	node1->data = 1;
	node2->next = node3;
	node2->data = 2;
	node3->next = node4;
	node3->data = 3;
	node4->data = 4;
	node4->next = NULL;

	SLTNode* plist = node1;
	SLTPrint(plist);
}

void test02() {
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 0);
	SLTPushFront(&plist, 0);
	SLTPushFront(&plist, 5);
	SLTPushFront(&plist, 6);
	SLTPushFront(&plist, 7);
	SLTInsert(&plist, SLTFind(plist, 5), 99);
	SLTInsertAfter(SLTFind(plist, 5), 100);
	SLTErase(&plist, SLTFind(plist, 5));
	SLTEraseAfter(SLTFind(plist, 99));
	SListDestroy(&plist);
	SLTPrint(plist);
}

int main() {
	test02();

	return 0;
}